CREATE TABLE jms_ods.yl_oms_oms_waybill_new (

 id bigint(20) NULL COMMENT '主键id',
  input_time datetime NULL COMMENT '录入时间',
  delivery_time datetime NULL COMMENT '寄件时间',
  pick_network_code varchar(70) NULL COMMENT '寄件网点code',
  waybill_no varchar(70) NULL COMMENT '运单号',
  goods_type_id bigint(20) NULL COMMENT '物品类型id',
  goods_type_code varchar(70) NULL COMMENT '物品类型code',
  goods_type_name varchar(120) NULL COMMENT '物品类型名称',
  package_volume double NULL COMMENT '包裹体积重单位千克',
  package_total_volume double NULL COMMENT '包裹总体积单位立方厘米',
  package_charge_weight double NULL COMMENT '包裹计费重量单位千克',
  collect_staff_code varchar(70) NULL COMMENT '揽件业务员code',
  collect_staff_name varchar(110) NULL COMMENT '揽件业务员名称',
  collect_time datetime NULL COMMENT '揽件时间',
  dispatch_staff_code varchar(70) NULL COMMENT '派件业务员code',
  dispatch_staff_name varchar(110) NULL COMMENT '派件业务员名称',
  dispatch_time datetime NULL COMMENT '派件时间',
  dispatch_network_id bigint(20) NULL COMMENT '派件网点id',
  dispatch_network_code varchar(70) NULL COMMENT '派件网点code',
  dispatch_network_name varchar(110) NULL COMMENT '派件网点名称',
  sign_network_id bigint(20) NULL COMMENT '签收网点id',
  sign_network_code varchar(70) NULL COMMENT '签收网点code',
  sign_network_name varchar(110) NULL COMMENT '签收网点名称',
  sign_time datetime NULL COMMENT '签收时间',
  customer_code varchar(70) NULL COMMENT '客户编号code',
  customer_name varchar(190) NULL COMMENT '客户名称',
  sender_province_name varchar(70) NULL COMMENT '寄件省份名称',
  sender_city_name varchar(70) NULL COMMENT '寄件城市名称',
  sender_area_name varchar(110) NULL COMMENT '寄件区域名称',
  sender_township varchar(250) NULL COMMENT '寄件乡镇',
  sender_detailed_address varchar(1060) NULL COMMENT '寄件详细地址',
  origin_id bigint(20) NULL COMMENT '始发地id',
  origin_code varchar(70) NULL COMMENT '始发地code',
  origin_name varchar(110) NULL COMMENT '始发地名称',
  pick_network_id bigint(20) NULL COMMENT '寄件网点id',
  pick_network_name varchar(110) NULL COMMENT '寄件网点名称',
  freight double NULL COMMENT '运费',
  total_freight double NULL COMMENT '总运费',
  handicraft_fee double NULL COMMENT '手工费',
  other_fee double NULL COMMENT '其他费',
  receive_pay_fee double NULL COMMENT '到付款',
  pick_finance_id bigint(20) NULL COMMENT '寄件财务中心id',
  pick_finance_code varchar(70) NULL COMMENT '寄件财务中心code',
  pick_finance_name varchar(110) NULL COMMENT '寄件财务中心名称',
  dispatch_finance_code varchar(70) NULL COMMENT '派件财务中心code',
  dispatch_finance_name varchar(110) NULL COMMENT '派件财务中心名称',
  express_type_id bigint(20) NULL COMMENT '产品类型id',
  express_type_code varchar(70) NULL COMMENT '产品类型code',
  express_type_name varchar(110) NULL COMMENT '产品类型名称',
  insured int(11) NULL COMMENT '是否需要保价1是，0否',
  insured_amount double NULL COMMENT '保价金额',
  insured_fee double NULL COMMENT '保价费',
  cod_need int(11) NULL COMMENT '是否需要代收货款1是，0否',
  cod_money double NULL COMMENT '代收货款金额',
  cod_fee double NULL COMMENT '代收货款手续费',
  settlement_name varchar(70) NULL COMMENT '结算方式名称',
  receiver_name varchar(190) NULL COMMENT '收件人姓名',
  receiver_country_name varchar(110) NULL COMMENT '收件国家名称',
  receiver_province_name varchar(110) NULL COMMENT '收件省份名称',
  receiver_city_name varchar(110) NULL COMMENT '收件城市名称',
  receiver_area_name varchar(110) NULL COMMENT '收件区域名称',
  receiver_township varchar(360) NULL COMMENT '收件乡镇',
  receiver_detailed_address varchar(1060) NULL COMMENT '收件详细地址',
  destination_id bigint(20) NULL COMMENT '目的地id',
  destination_code varchar(110) NULL COMMENT '目的地code',
  destination_name varchar(110) NULL COMMENT '目的地名称',
  input_staff_code varchar(110) NULL COMMENT '录入人code',
  input_staff_name varchar(110) NULL COMMENT '录入人名称',
  input_network_code varchar(110) NULL COMMENT '录入网点code',
  input_network_name varchar(110) NULL COMMENT '录入网点名称',
  coupon_amount double NULL COMMENT '优惠金额',
  is_cod_receive int(11) NULL COMMENT 'COD收款标识1是，0否',
  settlement_weight double NULL COMMENT '结算重量',
  order_source_code varchar(110) NULL COMMENT '订单来源编码',
  package_collect_weight double NULL COMMENT '收件重量单位千克',
  package_receipt_weight double NULL COMMENT '入仓重量单位千克',
  package_arrival_weight double NULL COMMENT '集散到件重量单位千克',
  package_inside_charge_weight double NULL COMMENT '内部计费重量单位千克',
  is_distribute_scan int(11) NULL COMMENT '转运中心扫描标识:1=已转运0=未转运默认0',
  is_arrival_scan int(11) NULL COMMENT '集散到件标识:1=是0=否默认0',
  waybill_weight double NULL COMMENT '运单重量单位千克',
  customer_network_code varchar(110) NULL COMMENT '客户网点code',
  customer_network_name varchar(110) NULL COMMENT '客户网点名称',
  customer_type bigint(20) NULL COMMENT '客户所属：1-总部共享2-代理区共享3-自有客户',
  calculate_fee_desc varchar(360) NULL COMMENT '算费描述',
  calculate_fee_code bigint(20) NULL COMMENT '算费描述code',
  package_center_arrival_weight double NULL COMMENT '中心到件重量'
)ENGINE=OLAP
UNIQUE KEY(id, input_time, delivery_time, pick_network_code, waybill_no)
COMMENT '运单表'
PARTITION BY RANGE(input_time)
(

    START ('2020-12-05') END ('2022-12-06') EVERY (INTERVAL 1 day)
)

DISTRIBUTED BY HASH(pick_network_code) BUCKETS 32
PROPERTIES (
'replication_num' = '3',
'dynamic_partition.enable' = 'true',
'dynamic_partition.time_unit' = 'DAY',
'dynamic_partition.time_zone' = 'Asia/Shanghai',
'dynamic_partition.start' = '-730',
'dynamic_partition.end' = '1',
'dynamic_partition.prefix' = 'p',
'dynamic_partition.buckets' = '32',
'in_memory' = 'false',
'storage_format' = 'V2'
);
